/********************************************************
  Stanford Driving Software
  Copyright (c) 2011 Stanford University
  All rights reserved.

  Redistribution and use in source and binary forms, with 
  or without modification, are permitted provided that the 
  following conditions are met:

* Redistributions of source code must retain the above 
  copyright notice, this list of conditions and the 
  following disclaimer.
* Redistributions in binary form must reproduce the above
  copyright notice, this list of conditions and the 
  following disclaimer in the documentation and/or other
  materials provided with the distribution.
* The names of the contributors may not be used to endorse
  or promote products derived from this software
  without specific prior written permission.

  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
  CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
  PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 
  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
  CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 
  OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
  DAMAGE.
 ********************************************************/


const double s_curve[377] = {0.000000, 1.061766, 2.115430, 3.160617, 4.196969, 5.224144, 6.241819, 7.249688, 8.247466, 9.234886, 10.211703, 11.177693, 12.132653, 13.076405, 14.008793, 14.929685, 15.838973, 16.736576, 17.622438, 18.496529, 19.358847, 20.209416, 21.048287, 21.875541, 22.691285, 23.495657, 24.288819, 25.070964, 25.842312, 26.603110, 27.353633, 28.094180, 28.825076, 29.546672, 30.259338, 30.963467, 31.659471, 32.347780, 33.028839, 33.703104, 34.371044, 35.033134, 35.689853, 36.341684, 36.989107, 37.632597, 38.272625, 38.909648, 39.544112, 40.176447, 40.807066, 41.436357, 42.064690, 42.692408, 43.319827, 43.947238, 44.574900, 45.203044, 45.831871, 46.461551, 47.092224, 47.724000, 48.356958, 48.991146, 49.626587, 50.263274, 50.901172, 51.540221, 52.180337, 52.821411, 53.463313, 54.105892, 54.748977, 55.392379, 56.035894, 56.679301, 57.322367, 57.964847, 58.606487, 59.247021, 59.886179, 60.523686, 61.159260, 61.792621, 62.423486, 63.051574, 63.676608, 64.298315, 64.916429, 65.530692, 66.140858, 66.746693, 67.347976, 67.944503, 68.536089, 69.122570, 69.703804, 70.279673, 70.850088, 71.414988, 71.974344, 72.528163, 73.076485, 73.619391, 74.157000, 74.689475, 75.217024, 75.739899, 76.258399, 76.772871, 77.283710, 77.791360, 78.296311, 78.799098, 79.300302, 79.800542, 80.300478, 80.800800, 81.302228, 81.805507, 82.311397, 82.820670, 83.334106, 83.852480, 84.376565, 84.907119, 85.444881, 85.990572, 86.544882, 87.108472, 87.681970, 88.265968, 88.861018, 89.467635, 90.086293, 90.717424, 91.361420, 92.018632, 92.689370, 93.373903, 94.072463, 94.785242, 95.512395, 96.254041, 97.010262, 97.781109, 98.566598, 99.366712, 100.181405, 101.010601, 101.854196, 102.712057, 103.584025, 104.469917, 105.369523, 106.282613, 107.208932, 108.148204, 109.100134, 110.064404, 111.040682, 112.028614, 113.027832, 114.037949, 115.058566, 116.089267, 117.129623, 118.179194, 119.237525, 120.304153, 121.378602, 122.460388, 123.549019, 124.643993, 125.744802, 126.850932, 127.961862, 129.077069, 130.196023, 131.318192, 132.443042, 133.570037, 134.698641, 135.828315, 136.958526, 138.088737, 139.218416, 140.347034, 141.474066, 142.598991, 143.721294, 144.840465, 145.956002, 147.067410, 148.174205, 149.275909, 150.372055, 151.462187, 152.545863, 153.622649, 154.692128, 155.753894, 156.807558, 157.852745, 158.889097, 159.916272, 160.933947, 161.941816, 162.939594, 163.927014, 164.903831, 165.869821, 166.824781, 167.768533, 168.700921, 169.621812, 170.531101, 171.428704, 172.314566, 173.188657, 174.050975, 174.901543, 175.740415, 176.567669, 177.383413, 178.187785, 178.980947, 179.763092, 180.534440, 181.295238, 182.045761, 182.786308, 183.517204, 184.238800, 184.951465, 185.655594, 186.351599, 187.039908, 187.720967, 188.395232, 189.063172, 189.725262, 190.381981, 191.033812, 191.681234, 192.324725, 192.964752, 193.601775, 194.236240, 194.868575, 195.499193, 196.128485, 196.756818, 197.384536, 198.011955, 198.639366, 199.267027, 199.895172, 200.523999, 201.153679, 201.784352, 202.416128, 203.049085, 203.683274, 204.318715, 204.955402, 205.593300, 206.232349, 206.872465, 207.513539, 208.155441, 208.798020, 209.441105, 210.084507, 210.728022, 211.371429, 212.014495, 212.656975, 213.298615, 213.939149, 214.578307, 215.215814, 215.851388, 216.484749, 217.115614, 217.743702, 218.368736, 218.990443, 219.608556, 220.222820, 220.832986, 221.438821, 222.040104, 222.636631, 223.228217, 223.814698, 224.395932, 224.971801, 225.542215, 226.107116, 226.666472, 227.220291, 227.768613, 228.311519, 228.849128, 229.381603, 229.909152, 230.432027, 230.950526, 231.464999, 231.975838, 232.483488, 232.988439, 233.491226, 233.992430, 234.492670, 234.992606, 235.492928, 235.994356, 236.497635, 237.003525, 237.512798, 238.026234, 238.544608, 239.068693, 239.599246, 240.137009, 240.682700, 241.237010, 241.800600, 242.374098, 242.958095, 243.553146, 244.159763, 244.778421, 245.409552, 246.053548, 246.710760, 247.381498, 248.066031, 248.764591, 249.477370, 250.204523, 250.946169, 251.702390, 252.473237, 253.258726, 254.058840, 254.873533, 255.702729, 256.546324, 257.404185, 258.276153, 259.162044, 260.061651, 260.974741, 261.901060, 262.840332, 263.792261, 264.756532, 265.732810, 266.720742, 267.719960, 268.730077, 269.750694, 270.781395, 271.821751, 272.871322, 273.929653, 274.996281, 276.070730, 277.152516, 278.241147, 279.336121, 280.436930, 281.543060, 282.653990};
 const double x_curve[377] = {11.242879, 12.167238, 13.088594, 14.006722, 14.921393, 15.832383, 16.739466, 17.642420, 18.541020, 19.435045, 20.324275, 21.208491, 22.087473, 22.961006, 23.828873, 24.690862, 25.546757, 26.396350, 27.239430, 28.075789, 28.905220, 29.727520, 30.542485, 31.349914, 32.149608, 32.941369, 33.725003, 34.500315, 35.267115, 36.025214, 36.774423, 37.514559, 38.245439, 38.966883, 39.678712, 40.380751, 41.072826, 41.754768, 42.426407, 43.087578, 43.738118, 44.377866, 45.006664, 45.624358, 46.230795, 46.825824, 47.409301, 47.981080, 48.541020, 49.088983, 49.624834, 50.148442, 50.659676, 51.158410, 51.644522, 52.117891, 52.578401, 53.025938, 53.460391, 53.881655, 54.289623, 54.684197, 55.065278, 55.432772, 55.786589, 56.126642, 56.452846, 56.765122, 57.063391, 57.347581, 57.617621, 57.873445, 58.114990, 58.342195, 58.555006, 58.753369, 58.937235, 59.106560, 59.261300, 59.401419, 59.526882, 59.637657, 59.733718, 59.815040, 59.881604, 59.933392, 59.970394, 59.992598, 60.000000, 59.992598, 59.970394, 59.933392, 59.881604, 59.815040, 59.733718, 59.637657, 59.526882, 59.401419, 59.261300, 59.106560, 58.937235, 58.753369, 58.555006, 58.342195, 58.114990, 57.873445, 57.617621, 57.347581, 57.063391, 56.765122, 56.452846, 56.126642, 55.786589, 55.432772, 55.065278, 54.684197, 54.289623, 53.881655, 53.460391, 53.025938, 52.578401, 52.117891, 51.644522, 51.158410, 50.659676, 50.148442, 49.624834, 49.088983, 48.541020, 47.981080, 47.409301, 46.825824, 46.230795, 45.624358, 45.006664, 44.377866, 43.738118, 43.087578, 42.426407, 41.754768, 41.072826, 40.380751, 39.678712, 38.966883, 38.245439, 37.514559, 36.774423, 36.025214, 35.267115, 34.500315, 33.725003, 32.941369, 32.149608, 31.349914, 30.542485, 29.727520, 28.905220, 28.075789, 27.239430, 26.396350, 25.546757, 24.690862, 23.828873, 22.961006, 22.087473, 21.208491, 20.324275, 19.435045, 18.541020, 17.642420, 16.739466, 15.832383, 14.921393, 14.006722, 13.088594, 12.167238, 11.242879, 10.315746, 9.386068, 8.454074, 7.519994, 6.584059, 5.646499, 4.707546, 3.767431, 2.826387, 1.884646, 0.942439, -0.000000, -0.942439, -1.884646, -2.826387, -3.767431, -4.707546, -5.646499, -6.584059, -7.519994, -8.454074, -9.386068, -10.315746, -11.242879, -12.167238, -13.088594, -14.006722, -14.921393, -15.832383, -16.739466, -17.642420, -18.541020, -19.435045, -20.324275, -21.208491, -22.087473, -22.961006, -23.828873, -24.690862, -25.546757, -26.396350, -27.239430, -28.075789, -28.905220, -29.727520, -30.542485, -31.349914, -32.149608, -32.941369, -33.725003, -34.500315, -35.267115, -36.025214, -36.774423, -37.514559, -38.245439, -38.966883, -39.678712, -40.380751, -41.072826, -41.754768, -42.426407, -43.087578, -43.738118, -44.377866, -45.006664, -45.624358, -46.230795, -46.825824, -47.409301, -47.981080, -48.541020, -49.088983, -49.624834, -50.148442, -50.659676, -51.158410, -51.644522, -52.117891, -52.578401, -53.025938, -53.460391, -53.881655, -54.289623, -54.684197, -55.065278, -55.432772, -55.786589, -56.126642, -56.452846, -56.765122, -57.063391, -57.347581, -57.617621, -57.873445, -58.114990, -58.342195, -58.555006, -58.753369, -58.937235, -59.106560, -59.261300, -59.401419, -59.526882, -59.637657, -59.733718, -59.815040, -59.881604, -59.933392, -59.970394, -59.992598, -60.000000, -59.992598, -59.970394, -59.933392, -59.881604, -59.815040, -59.733718, -59.637657, -59.526882, -59.401419, -59.261300, -59.106560, -58.937235, -58.753369, -58.555006, -58.342195, -58.114990, -57.873445, -57.617621, -57.347581, -57.063391, -56.765122, -56.452846, -56.126642, -55.786589, -55.432772, -55.065278, -54.684197, -54.289623, -53.881655, -53.460391, -53.025938, -52.578401, -52.117891, -51.644522, -51.158410, -50.659676, -50.148442, -49.624834, -49.088983, -48.541020, -47.981080, -47.409301, -46.825824, -46.230795, -45.624358, -45.006664, -44.377866, -43.738118, -43.087578, -42.426407, -41.754768, -41.072826, -40.380751, -39.678712, -38.966883, -38.245439, -37.514559, -36.774423, -36.025214, -35.267115, -34.500315, -33.725003, -32.941369, -32.149608, -31.349914, -30.542485, -29.727520, -28.905220, -28.075789, -27.239430, -26.396350, -25.546757, -24.690862, -23.828873, -22.961006, -22.087473, -21.208491, -20.324275, -19.435045, -18.541020, -17.642420, -16.739466, -15.832383, -14.921393, -14.006722, -13.088594, -12.167238, -11.242879};
 const double y_curve[377] = {-10.848831, -11.371237, -11.882421, -12.381879, -12.869117, -13.343655, -13.805025, -14.252770, -14.686450, -15.105636, -15.509915, -15.898887, -16.272169, -16.629392, -16.970204, -17.294269, -17.601266, -17.890893, -18.162863, -18.416910, -18.652780, -18.870243, -19.069083, -19.249105, -19.410129, -19.551999, -19.674573, -19.777730, -19.861369, -19.925408, -19.969782, -19.994449, -19.999383, -19.984581, -19.950056, -19.895843, -19.821995, -19.728585, -19.615706, -19.483468, -19.332002, -19.161458, -18.972004, -18.763827, -18.537132, -18.292143, -18.029102, -17.748269, -17.449920, -17.134350, -16.801871, -16.452810, -16.087513, -15.706339, -15.309664, -14.897881, -14.471396, -14.030629, -13.576015, -13.108003, -12.627056, -12.133647, -11.628264, -11.111405, -10.583580, -10.045311, -9.497128, -8.939572, -8.373195, -7.798554, -7.216217, -6.626758, -6.030759, -5.428809, -4.821501, -4.209435, -3.593215, -2.973449, -2.350748, -1.725727, -1.099004, -0.471195, 0.157078, 0.785196, 1.412540, 2.038489, 2.662427, 3.283737, 3.901806, 4.516025, 5.125787, 5.730491, 6.329539, 6.922341, 7.508311, 8.086872, 8.657452, 9.219487, 9.772425, 10.315718, 10.848831, 11.371237, 11.882421, 12.381879, 12.869117, 13.343655, 13.805025, 14.252770, 14.686450, 15.105636, 15.509915, 15.898887, 16.272169, 16.629392, 16.970204, 17.294269, 17.601266, 17.890893, 18.162863, 18.416910, 18.652780, 18.870243, 19.069083, 19.249105, 19.410129, 19.551999, 19.674573, 19.777730, 19.861369, 19.925408, 19.969782, 19.994449, 19.999383, 19.984581, 19.950056, 19.895843, 19.821995, 19.728585, 19.615706, 19.483468, 19.332002, 19.161458, 18.972004, 18.763827, 18.537132, 18.292143, 18.029102, 17.748269, 17.449920, 17.134350, 16.801871, 16.452810, 16.087513, 15.706339, 15.309664, 14.897881, 14.471396, 14.030629, 13.576015, 13.108003, 12.627056, 12.133647, 11.628264, 11.111405, 10.583580, 10.045311, 9.497128, 8.939572, 8.373195, 7.798554, 7.216217, 6.626758, 6.030759, 5.428809, 4.821501, 4.209435, 3.593215, 2.973449, 2.350748, 1.725727, 1.099004, 0.471195, -0.157078, -0.785196, -1.412540, -2.038489, -2.662427, -3.283737, -3.901806, -4.516025, -5.125787, -5.730491, -6.329539, -6.922341, -7.508311, -8.086872, -8.657452, -9.219487, -9.772425, -10.315718, -10.848831, -11.371237, -11.882421, -12.381879, -12.869117, -13.343655, -13.805025, -14.252770, -14.686450, -15.105636, -15.509915, -15.898887, -16.272169, -16.629392, -16.970204, -17.294269, -17.601266, -17.890893, -18.162863, -18.416910, -18.652780, -18.870243, -19.069083, -19.249105, -19.410129, -19.551999, -19.674573, -19.777730, -19.861369, -19.925408, -19.969782, -19.994449, -19.999383, -19.984581, -19.950056, -19.895843, -19.821995, -19.728585, -19.615706, -19.483468, -19.332002, -19.161458, -18.972004, -18.763827, -18.537132, -18.292143, -18.029102, -17.748269, -17.449920, -17.134350, -16.801871, -16.452810, -16.087513, -15.706339, -15.309664, -14.897881, -14.471396, -14.030629, -13.576015, -13.108003, -12.627056, -12.133647, -11.628264, -11.111405, -10.583580, -10.045311, -9.497128, -8.939572, -8.373195, -7.798554, -7.216217, -6.626758, -6.030759, -5.428809, -4.821501, -4.209435, -3.593215, -2.973449, -2.350748, -1.725727, -1.099004, -0.471195, 0.157078, 0.785196, 1.412540, 2.038489, 2.662427, 3.283737, 3.901806, 4.516025, 5.125787, 5.730491, 6.329539, 6.922341, 7.508311, 8.086872, 8.657452, 9.219487, 9.772425, 10.315718, 10.848831, 11.371237, 11.882421, 12.381879, 12.869117, 13.343655, 13.805025, 14.252770, 14.686450, 15.105636, 15.509915, 15.898887, 16.272169, 16.629392, 16.970204, 17.294269, 17.601266, 17.890893, 18.162863, 18.416910, 18.652780, 18.870243, 19.069083, 19.249105, 19.410129, 19.551999, 19.674573, 19.777730, 19.861369, 19.925408, 19.969782, 19.994449, 19.999383, 19.984581, 19.950056, 19.895843, 19.821995, 19.728585, 19.615706, 19.483468, 19.332002, 19.161458, 18.972004, 18.763827, 18.537132, 18.292143, 18.029102, 17.748269, 17.449920, 17.134350, 16.801871, 16.452810, 16.087513, 15.706339, 15.309664, 14.897881, 14.471396, 14.030629, 13.576015, 13.108003, 12.627056, 12.133647, 11.628264, 11.111405, 10.583580, 10.045311, 9.497128, 8.939572, 8.373195, 7.798554, 7.216217, 6.626758, 6.030759, 5.428809, 4.821501, 4.209435, 3.593215};
 const double theta_curve[377] = {-0.518190, -0.510537, -0.502447, -0.493910, -0.484916, -0.475452, -0.465506, -0.455066, -0.444119, -0.432651, -0.420647, -0.408094, -0.394976, -0.381279, -0.366987, -0.352085, -0.336558, -0.320390, -0.303567, -0.286073, -0.267895, -0.249020, -0.229436, -0.209132, -0.188098, -0.166328, -0.143815, -0.120558, -0.096555, -0.071810, -0.046329, -0.020123, 0.006795, 0.034406, 0.062688, 0.091612, 0.121148, 0.151257, 0.181900, 0.213030, 0.244598, 0.276550, 0.308831, 0.341383, 0.374144, 0.407053, 0.440049, 0.473071, 0.506058, 0.538953, 0.571700, 0.604249, 0.636550, 0.668561, 0.700242, 0.731560, 0.762485, 0.792993, 0.823066, 0.852689, 0.881852, 0.910552, 0.938787, 0.966560, 0.993878, 1.020753, 1.047196, 1.073224, 1.098855, 1.124111, 1.149014, 1.173588, 1.197859, 1.221856, 1.245607, 1.269141, 1.292490, 1.315687, 1.338763, 1.361752, 1.384691, 1.407613, 1.430556, 1.453557, 1.476654, 1.499886, 1.523293, 1.546916, 1.570796, 1.594977, 1.619502, 1.644415, 1.669761, 1.695587, 1.721937, 1.748860, 1.776401, 1.804607, 1.833523, 1.863194, 1.893661, 1.924967, 1.957146, 1.990230, 2.024248, 2.059219, 2.095155, 2.132060, 2.169926, 2.208734, 2.248452, 2.289033, 2.330418, 2.372531, 2.415280, 2.458562, 2.502258, 2.546241, 2.590373, 2.634509, 2.678504, 2.722209, 2.765482, 2.808185, 2.850190, 2.891377, 2.931644, 2.970898, 3.009063, 3.046078, 3.081894, 3.116477, -3.133379, -3.101314, -3.070514, -3.040970, -3.012668, -2.985584, -2.959693, -2.934964, -2.911363, -2.888856, -2.867406, -2.846974, -2.827525, -2.809020, -2.791422, -2.774696, -2.758807, -2.743721, -2.729406, -2.715829, -2.702963, -2.690778, -2.679248, -2.668346, -2.658050, -2.648337, -2.639185, -2.630574, -2.622486, -2.614902, -2.607807, -2.601185, -2.595022, -2.589304, -2.584019, -2.579157, -2.574706, -2.570656, -2.567000, -2.563728, -2.560834, -2.558311, -2.556153, -2.554355, -2.552913, -2.551822, -2.551080, -2.550684, -2.550630, -2.550920, -2.551550, -2.552521, -2.553832, -2.555486, -2.557482, -2.559823, -2.562511, -2.565549, -2.568939, -2.572687, -2.576797, -2.581273, -2.586121, -2.591347, -2.596958, -2.602961, -2.609364, -2.616175, -2.623402, -2.631056, -2.639146, -2.647683, -2.656677, -2.666141, -2.676087, -2.686526, -2.697474, -2.708942, -2.720946, -2.733499, -2.746617, -2.760314, -2.774605, -2.789507, -2.805035, -2.821202, -2.838026, -2.855520, -2.873697, -2.892572, -2.912156, -2.932461, -2.953494, -2.975265, -2.997777, -3.021035, -3.045038, -3.069783, -3.095263, -3.121470, 3.134797, 3.107186, 3.078905, 3.049980, 3.020445, 2.990335, 2.959693, 2.928563, 2.896995, 2.865042, 2.832761, 2.800210, 2.767449, 2.734539, 2.701543, 2.668522, 2.635535, 2.602640, 2.569892, 2.537344, 2.505042, 2.473032, 2.441350, 2.410033, 2.379108, 2.348599, 2.318527, 2.288904, 2.259740, 2.231041, 2.202806, 2.175033, 2.147714, 2.120840, 2.094397, 2.068369, 2.042737, 2.017482, 1.992579, 1.968005, 1.943733, 1.919736, 1.895986, 1.872452, 1.849102, 1.825906, 1.802830, 1.779840, 1.756902, 1.733979, 1.711036, 1.688036, 1.664939, 1.641707, 1.618300, 1.594677, 1.570796, 1.546615, 1.522091, 1.497178, 1.471831, 1.446006, 1.419655, 1.392733, 1.365192, 1.336986, 1.308070, 1.278399, 1.247931, 1.216626, 1.184447, 1.151362, 1.117345, 1.082374, 1.046438, 1.009533, 0.971667, 0.932859, 0.893141, 0.852559, 0.811174, 0.769062, 0.726313, 0.683031, 0.639334, 0.595351, 0.551220, 0.507083, 0.463089, 0.419383, 0.376110, 0.333407, 0.291403, 0.250215, 0.209949, 0.170695, 0.132530, 0.095515, 0.059699, 0.025115, -0.008214, -0.040279, -0.071079, -0.100622, -0.128925, -0.156009, -0.181900, -0.206629, -0.230229, -0.252737, -0.274187, -0.294618, -0.314068, -0.332573, -0.350170, -0.366896, -0.382785, -0.397871, -0.412187, -0.425763, -0.438630, -0.450815, -0.462345, -0.473246, -0.483542, -0.493256, -0.502408, -0.511019, -0.519107, -0.526691, -0.533786, -0.540408, -0.546571, -0.552289, -0.557573, -0.562436, -0.566887, -0.570937, -0.574593, -0.577865, -0.580759, -0.583282, -0.585440, -0.587237, -0.588680};
 const double kappa_curve[377] = {0.006980, 0.007440, 0.007920, 0.008420, 0.008943, 0.009489, 0.010062, 0.010661, 0.011289, 0.011947, 0.012637, 0.013360, 0.014119, 0.014915, 0.015749, 0.016623, 0.017538, 0.018495, 0.019496, 0.020540, 0.021629, 0.022762, 0.023939, 0.025158, 0.026419, 0.027719, 0.029055, 0.030423, 0.031819, 0.033236, 0.034669, 0.036109, 0.037548, 0.038978, 0.040387, 0.041764, 0.043099, 0.044379, 0.045593, 0.046729, 0.047776, 0.048724, 0.049565, 0.050289, 0.050891, 0.051367, 0.051715, 0.051934, 0.052025, 0.051993, 0.051842, 0.051580, 0.051215, 0.050757, 0.050215, 0.049601, 0.048926, 0.048201, 0.047437, 0.046645, 0.045834, 0.045016, 0.044198, 0.043388, 0.042595, 0.041826, 0.041085, 0.040378, 0.039711, 0.039087, 0.038510, 0.037983, 0.037509, 0.037092, 0.036732, 0.036432, 0.036195, 0.036022, 0.035916, 0.035877, 0.035909, 0.036014, 0.036193, 0.036449, 0.036785, 0.037204, 0.037708, 0.038300, 0.038984, 0.039763, 0.040640, 0.041620, 0.042705, 0.043899, 0.045204, 0.046625, 0.048162, 0.049816, 0.051589, 0.053478, 0.055479, 0.057589, 0.059798, 0.062095, 0.064465, 0.066891, 0.069347, 0.071807, 0.074239, 0.076606, 0.078866, 0.080977, 0.082893, 0.084567, 0.085956, 0.087017, 0.087715, 0.088022, 0.087918, 0.087394, 0.086453, 0.085108, 0.083383, 0.081310, 0.078930, 0.076288, 0.073432, 0.070412, 0.067276, 0.064070, 0.060836, 0.057610, 0.054426, 0.051310, 0.048283, 0.045363, 0.042561, 0.039887, 0.037344, 0.034936, 0.032662, 0.030519, 0.028506, 0.026617, 0.024846, 0.023189, 0.021639, 0.020190, 0.018835, 0.017570, 0.016386, 0.015280, 0.014245, 0.013277, 0.012370, 0.011519, 0.010721, 0.009971, 0.009266, 0.008602, 0.007975, 0.007384, 0.006824, 0.006293, 0.005789, 0.005310, 0.004853, 0.004417, 0.003999, 0.003598, 0.003212, 0.002840, 0.002480, 0.002131, 0.001791, 0.001461, 0.001137, 0.000820, 0.000508, 0.000200, -0.000105, -0.000408, -0.000709, -0.001010, -0.001312, -0.001615, -0.001920, -0.002229, -0.002542, -0.002860, -0.003184, -0.003515, -0.003854, -0.004202, -0.004560, -0.004929, -0.005311, -0.005705, -0.006114, -0.006539, -0.006980, -0.007440, -0.007920, -0.008420, -0.008943, -0.009489, -0.010062, -0.010661, -0.011289, -0.011947, -0.012637, -0.013360, -0.014119, -0.014915, -0.015749, -0.016623, -0.017538, -0.018495, -0.019496, -0.020540, -0.021629, -0.022762, -0.023939, -0.025158, -0.026419, -0.027719, -0.029055, -0.030423, -0.031819, -0.033236, -0.034669, -0.036109, -0.037548, -0.038978, -0.040387, -0.041764, -0.043099, -0.044379, -0.045593, -0.046729, -0.047776, -0.048724, -0.049565, -0.050289, -0.050891, -0.051367, -0.051715, -0.051934, -0.052025, -0.051993, -0.051842, -0.051580, -0.051215, -0.050757, -0.050215, -0.049601, -0.048926, -0.048201, -0.047437, -0.046645, -0.045834, -0.045016, -0.044198, -0.043388, -0.042595, -0.041826, -0.041085, -0.040378, -0.039711, -0.039087, -0.038510, -0.037983, -0.037509, -0.037092, -0.036732, -0.036432, -0.036195, -0.036022, -0.035916, -0.035877, -0.035909, -0.036014, -0.036193, -0.036449, -0.036785, -0.037204, -0.037708, -0.038300, -0.038984, -0.039763, -0.040640, -0.041620, -0.042705, -0.043899, -0.045204, -0.046625, -0.048162, -0.049816, -0.051589, -0.053478, -0.055479, -0.057589, -0.059798, -0.062095, -0.064465, -0.066891, -0.069347, -0.071807, -0.074239, -0.076606, -0.078866, -0.080977, -0.082893, -0.084567, -0.085956, -0.087017, -0.087715, -0.088022, -0.087918, -0.087394, -0.086453, -0.085108, -0.083383, -0.081310, -0.078930, -0.076288, -0.073432, -0.070412, -0.067276, -0.064070, -0.060836, -0.057610, -0.054426, -0.051310, -0.048283, -0.045363, -0.042561, -0.039887, -0.037344, -0.034936, -0.032662, -0.030519, -0.028506, -0.026617, -0.024846, -0.023189, -0.021639, -0.020190, -0.018835, -0.017570, -0.016386, -0.015280, -0.014245, -0.013277, -0.012370, -0.011519, -0.010721, -0.009971, -0.009266, -0.008602, -0.007975, -0.007384, -0.006824, -0.006293, -0.005789, -0.005310, -0.004853, -0.004417, -0.003999, -0.003598, -0.003212, -0.002840, -0.002480, -0.002131, -0.001791, -0.001461, -0.001137};
 const double kappa_prime_curve[377] = {0.000423, 0.000444, 0.000467, 0.000491, 0.000518, 0.000547, 0.000578, 0.000612, 0.000647, 0.000686, 0.000727, 0.000771, 0.000818, 0.000868, 0.000921, 0.000977, 0.001036, 0.001098, 0.001162, 0.001228, 0.001297, 0.001367, 0.001439, 0.001510, 0.001581, 0.001651, 0.001717, 0.001780, 0.001837, 0.001887, 0.001929, 0.001959, 0.001977, 0.001981, 0.001969, 0.001940, 0.001892, 0.001824, 0.001737, 0.001630, 0.001503, 0.001358, 0.001197, 0.001023, 0.000836, 0.000642, 0.000443, 0.000243, 0.000045, -0.000146, -0.000329, -0.000501, -0.000658, -0.000800, -0.000924, -0.001030, -0.001118, -0.001188, -0.001239, -0.001274, -0.001293, -0.001296, -0.001286, -0.001264, -0.001230, -0.001187, -0.001135, -0.001075, -0.001009, -0.000937, -0.000860, -0.000779, -0.000694, -0.000605, -0.000513, -0.000418, -0.000319, -0.000218, -0.000113, -0.000005, 0.000106, 0.000222, 0.000343, 0.000468, 0.000598, 0.000735, 0.000878, 0.001028, 0.001186, 0.001352, 0.001526, 0.001709, 0.001902, 0.002103, 0.002313, 0.002532, 0.002758, 0.002990, 0.003225, 0.003462, 0.003695, 0.003921, 0.004133, 0.004325, 0.004488, 0.004613, 0.004690, 0.004709, 0.004658, 0.004527, 0.004307, 0.003992, 0.003578, 0.003066, 0.002459, 0.001770, 0.001013, 0.000207, -0.000624, -0.001454, -0.002258, -0.003012, -0.003693, -0.004286, -0.004778, -0.005163, -0.005439, -0.005612, -0.005687, -0.005676, -0.005591, -0.005445, -0.005250, -0.005019, -0.004763, -0.004490, -0.004210, -0.003930, -0.003653, -0.003385, -0.003129, -0.002885, -0.002656, -0.002442, -0.002243, -0.002059, -0.001890, -0.001735, -0.001593, -0.001463, -0.001344, -0.001237, -0.001139, -0.001050, -0.000969, -0.000895, -0.000829, -0.000769, -0.000714, -0.000664, -0.000620, -0.000579, -0.000542, -0.000509, -0.000479, -0.000452, -0.000427, -0.000405, -0.000385, -0.000367, -0.000351, -0.000337, -0.000324, -0.000313, -0.000303, -0.000295, -0.000288, -0.000282, -0.000277, -0.000273, -0.000270, -0.000268, -0.000267, -0.000267, -0.000267, -0.000269, -0.000272, -0.000275, -0.000280, -0.000286, -0.000292, -0.000300, -0.000308, -0.000318, -0.000329, -0.000341, -0.000355, -0.000369, -0.000386, -0.000403, -0.000423, -0.000444, -0.000467, -0.000491, -0.000518, -0.000547, -0.000578, -0.000612, -0.000647, -0.000686, -0.000727, -0.000771, -0.000818, -0.000868, -0.000921, -0.000977, -0.001036, -0.001098, -0.001162, -0.001228, -0.001297, -0.001367, -0.001439, -0.001510, -0.001581, -0.001651, -0.001717, -0.001780, -0.001837, -0.001887, -0.001929, -0.001959, -0.001977, -0.001981, -0.001969, -0.001940, -0.001892, -0.001824, -0.001737, -0.001630, -0.001503, -0.001358, -0.001197, -0.001023, -0.000836, -0.000642, -0.000443, -0.000243, -0.000045, 0.000146, 0.000329, 0.000501, 0.000658, 0.000800, 0.000924, 0.001030, 0.001118, 0.001188, 0.001239, 0.001274, 0.001293, 0.001296, 0.001286, 0.001264, 0.001230, 0.001187, 0.001135, 0.001075, 0.001009, 0.000937, 0.000860, 0.000779, 0.000694, 0.000605, 0.000513, 0.000418, 0.000319, 0.000218, 0.000113, 0.000005, -0.000106, -0.000222, -0.000343, -0.000468, -0.000598, -0.000735, -0.000878, -0.001028, -0.001186, -0.001352, -0.001526, -0.001709, -0.001902, -0.002103, -0.002313, -0.002532, -0.002758, -0.002990, -0.003225, -0.003462, -0.003695, -0.003921, -0.004133, -0.004325, -0.004488, -0.004613, -0.004690, -0.004709, -0.004658, -0.004527, -0.004307, -0.003992, -0.003578, -0.003066, -0.002459, -0.001770, -0.001013, -0.000207, 0.000624, 0.001454, 0.002258, 0.003012, 0.003693, 0.004286, 0.004778, 0.005163, 0.005439, 0.005612, 0.005687, 0.005676, 0.005591, 0.005445, 0.005250, 0.005019, 0.004763, 0.004490, 0.004210, 0.003930, 0.003653, 0.003385, 0.003129, 0.002885, 0.002656, 0.002442, 0.002243, 0.002059, 0.001890, 0.001735, 0.001593, 0.001463, 0.001344, 0.001237, 0.001139, 0.001050, 0.000969, 0.000895, 0.000829, 0.000769, 0.000714, 0.000664, 0.000620, 0.000579, 0.000542, 0.000509, 0.000479, 0.000452, 0.000427, 0.000405, 0.000385, 0.000367, 0.000351, 0.000337, 0.000324, 0.000313, 0.000303, 0.000295, 0.000288};
 const int number_of_curve_points = 377;
  
